package com.pur.zsms.pmsnmanage.menu.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.pur.zsms.common.dao.GenericDao;
import com.pur.zsms.common.exception.GenericException;
import com.pur.zsms.pmsnmanage.menu.dao.IMenuDao;
import com.pur.zsms.pmsnmanage.menu.po.MenuPo;
@Repository("menuDao")
public class MenuDaoImpl extends GenericDao implements IMenuDao{

	@Override
	public List<MenuPo> findMenus() throws GenericException {
		// TODO Auto-generated method stub
		 return this.entityManager.createQuery("from MenuPo").getResultList();
	}

	@Override
	public MenuPo findMenu(String menuId) throws GenericException {
		// TODO Auto-generated method stub
		return (MenuPo)this.entityManager.createQuery("from MenuPo m where m.menuId='"+menuId+"'").getSingleResult();
	}
	
}
